package com.cloudlead.common.worker.desc.datatype;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class TypeDesc {
	private Class<?> rawType;
	private Type type;
	private List<TypeDesc> elementType;
	private boolean collectionType;
	private boolean primitiveType;
	private boolean enumType;

	public Class<?> getRawType() {
		return rawType;
	}

	public void setRawType(Class<?> rawType) {
		this.rawType = rawType;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public List<TypeDesc> getElementType() {
		return elementType;
	}

	public void setElementType(List<TypeDesc> elementType) {
		this.elementType = elementType;
	}

	public void addElementType(TypeDesc typeDesc) {
		if (null == this.elementType) {
			this.elementType = new ArrayList<>();
		}
		this.elementType.add(typeDesc);
	}

	public boolean isCollectionType() {
		return collectionType;
	}

	public void setCollectionType(boolean collectionType) {
		this.collectionType = collectionType;
	}

	public boolean isPrimitiveType() {
		return primitiveType;
	}

	public void setPrimitiveType(boolean primitiveType) {
		this.primitiveType = primitiveType;
	}

	public boolean isEnumType() {
		return enumType;
	}

	public void setEnumType(boolean enumType) {
		this.enumType = enumType;
	}

}
